import request from '@/utils/request'

// 创建请求所有频道的ajax

export const getAllChannels = () => {
  return request({
    methods: 'GET',
    url: '/app/v1_0/channels'
  })
}
// export const addUserChannel = (channel) => {
//   return request({
//     method: 'PATCH',
//     url: '/app/v1_0/user/channels',
//     data: {
//       channels: [channel]
//     }
//   })
// }
// 修改用户频道列表
export const addUserChannel = channel => {
  return request({
    // GET POST PUT DELETE  PATCH(部分更新)
    method: 'PATCH',
    url: '/app/v1_0/user/channels',
    data: {
      channels: [channel]
    }
  })
}

// 删除用户频道列表
export const deleteUserChannel = channelId => {
  return request({
    // 各种请求方式GET POST PUT DELETE  PATCH(部分更新)
    method: 'DELETE',
    // url: `/app/v1_0/user/channels${channelsId}`
    url: `/app/v1_0/user/channels/${channelId}`

  })
}
